<?php
class Model_Session extends Zend_Db_Table_Abstract {
    protected $_name = 'PMT_HUMAN_SESSION';
    protected $_primary = 'USERNAME';
    
    public function sessionExists($user){
        $db = $this->getDefaultAdapter();
        $sql = "SELECT COUNT(1) AS existe FROM PMT_HUMAN_SESSION WHERE USERNAME = '".$user."'";
        $stmt = $db->query($sql);                                
        $result = $stmt->fetchObject();
        return $result->existe;
    }    
}
?>
